
import apiType, {
    GET_INVENTORY_COMMON_EXPRESS_PLATFORM,
    GET_WAREHOUSE_ORDER_PROCESS,
    GET_WAREHOUSE_ORDER_INFO,
    GET_INVENTORY_SALES_LIST
} from "@constants/ActionTypes";

const initialState = {
    commonExpressPlatform: [],    //配送平台列表
    processOrderListMap:{},
    warehouseOrderInfo: {},    //订单详情
    inventorySalesList: {},    //经销存报表
}

export default function update(state = initialState, action) {
    const { response, params, payload } = action
    switch (action.type) {
        case apiType(GET_INVENTORY_COMMON_EXPRESS_PLATFORM).success:
            return {
                ...state,
                commonExpressPlatform: response.platforms,
            }
        case apiType(GET_WAREHOUSE_ORDER_PROCESS).success:
            return {
                ...state,
                processOrderListMap: response,
            }
        case apiType(GET_WAREHOUSE_ORDER_INFO).success:
            return {
                ...state,
                warehouseOrderInfo: response,
            }
        case apiType(GET_INVENTORY_SALES_LIST).success:
            return {
                ...state,
                inventorySalesList: response,
            }

        default:
            return state
    }
}